﻿using Himp.Base;
using Himp.DataHub;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;

namespace Himp.ShareData
{
    /// <summary>
    /// 患者主索引
    /// </summary>
    public class PatnMasterIdx : AuditedAggregateRoot<Guid>, IMultiTenant
    {
        #region 属性

        /// <summary>
        /// 主索引分类代码
        /// </summary>
        public EnumMasterIdxType MasterIdxType { get; set; }

        /// <summary>
        /// 索引值
        /// </summary>
        public string MaterIdxValue { get; set; }

        /// <summary>
        /// 患者id
        /// </summary>
        public string PatnId { get; set; }

        /// <summary>
        /// 门诊号
        /// </summary>
        public string OtpNo { get; set; }

        /// <summary>
        /// 人员姓名
        /// </summary>
        public string PatnName { get; private set; }

        /// <summary>
        /// 性别 1男 2女
        /// </summary>
        public EnumGender Gend { get; private set; }

        /// <summary>
        /// 出生日期
        /// </summary>
        public string? Brdy { get; private set; }

        /// <summary>
        /// 
        /// </summary>
        public Guid? TenantId { get; set; }

        /// <summary>
        /// 患者基本信息
        /// </summary>
        public PatnBaseInfo PatnBaseInfo { get; set; }

        /// <summary>
        /// 患者卡信息
        /// </summary>
        public IList<PatnCardInfo> PatnCardInfoes { get; set; }

        #endregion

        #region 方法

        private PatnMasterIdx()
        { 
        
        }

        /// <summary>
        /// 
        /// </summary>
        internal PatnMasterIdx(EnumMasterIdxType masterIdxType, string materIdxValue, string patnId, string patnName
            , EnumGender gend, string brdy,string otpNo)
        {
            MasterIdxType = masterIdxType;
            MaterIdxValue = materIdxValue;
            PatnId = patnId;
            PatnName = patnName;
            Gend = gend;
            Brdy = brdy;
            OtpNo = otpNo;
            //PatnMasterIdxAssocOtpNos = new List<string>();
            //PatnMasterIdxAssocOtpNos = new List<string>();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="psnName"></param>
        /// <returns></returns>
        internal PatnMasterIdx ChangePsnName(string psnName)
        {
            PatnName = psnName;
            return this;
        }

        #endregion
    }
}
